# 方法1：非递归

n = 5
sum = 1
for i in range(1, n + 1):
    sum *= i
print(sum)


# 方法2：递归
def jiecheng(num):
    if num == 1:
        return 1
    else:
        return num * jiecheng(num - 1)


print(jiecheng(n))
